import 'package:get/get.dart';

import '../modules/good_search/bindings/good_search_binding.dart';
import '../modules/good_search/bindings/good_search_binding.dart';
import '../modules/good_search/views/good_search_view.dart';
import '../modules/good_search/views/good_search_view.dart';
import '../modules/gooddetail/bindings/gooddetail_binding.dart';
import '../modules/gooddetail/views/gooddetail_view.dart';
import '../modules/goodlist/bindings/goodlist_binding.dart';
import '../modules/goodlist/views/goodlist_view.dart';
import '../modules/home/bindings/home_binding.dart';
import '../modules/home/views/home_view.dart';

part 'app_routes.dart';

class AppPages {
  AppPages._();

  static const INITIAL = _Paths.HOME;

  static final routes = [
    GetPage(
      name: _Paths.HOME,
      page: () => const HomeView(),
      //在对应的路由配置和页面绑定的Controller
      binding: HomeBinding(),
    ),
    GetPage(
      name: _Paths.GOODLIST,
      page: () => const GoodlistView(),
      binding: GoodlistBinding(),
    ),
    GetPage(
      name: _Paths.GOODDETAIL,
      ///当需要再GooddetailView 中使用非const的对象的时候，GooddetailView不能使用const修饰
      page: () =>  GooddetailView(),
      binding: GooddetailBinding(),
    ),
    GetPage(
      transition: Transition.fadeIn,
      name: _Paths.GOOD_SEARCH,
      page: () => const GoodSearchView(),
      binding: GoodSearchBinding(),
      children: [
        GetPage(
          name: _Paths.GOOD_SEARCH,
          page: () => const GoodSearchView(),
          binding: GoodSearchBinding(),
        ),
      ],
    ),
  ];
}
